package com.webshop.account.controller;

import com.webshop.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by LBG on 2019/6/23.
 */
@RestController
@RequestMapping("/register")
public class RegisterController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("/getVeriCode")
    public Map<String, Object> getVerificationCode(String phoneNum) {
        return accountService.getVerificationCode(phoneNum);
    }

    @RequestMapping("/testVeriCode")
    public Map<String, Object> testVerificationCode(String phoneNum, String veriCode) {
        return accountService.testVerificationCode(phoneNum, veriCode);
    }

    @RequestMapping("/registerAccount")
    public Map<String, Object> registerAccount(String phoneNum, String password, String veriCode) {
        return accountService.registerAccount(phoneNum, password, veriCode);
    }
}
